#pragma once
#include<QThread>
#include<iostream>
#include<opencv2/imgcodecs.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgproc.hpp>
//继承qt线程
using namespace cv;
class XVideoThread: public QThread
{
	Q_OBJECT

public:
	VideoCapture cap1;
	~XVideoThread();
	
	static XVideoThread *instance() {
		static XVideoThread xt;
		return &xt;
	}
	virtual void run();
	double getPos();
	bool openVideo(const std::string fileName);
	bool seek(int frame);
	bool seek(double frame);
	//创建信号槽 底层机制是队列  
	//不需要实现
signals:
	void ViewImage1(Mat mat);

	//外部不可实例化
protected:
	QMutex mutex;
	bool isExit;
	int fps = 0;
	int durationPer = 40;
	XVideoThread();
};

